<script setup>
import { ref } from 'vue';

const handleClick = () => {
  bBar.value = !bBar.value
}
const bBar = ref(false)
</script>
<template>
  <div>
    Child
    <button @click="handleClick">出现弹框</button>
    <!-- <Teleport to="body"> -->
    <Teleport to="#dialog">
      <div v-if="bBar" :style="{ width: '100px', height: '100px', backgroundColor: 'teal' }"></div>
    </Teleport>
  </div>
</template>
